home *** CD-ROM | disk | FTP | other *** search
- Path: ipdyne44.vir.com!optimal
- From: optimal@vir.com (optimal)
- Newsgroups: comp.lang.c
- Subject: sequence pts wrt pointer dereferencing
- Date: Fri, 5 Jan 1996 15:52:31 UNDEFINED
- Organization: Communications Vir
- Message-ID: <optimal.8.7116A605@vir.com>
- NNTP-Posting-Host: ipdyne44.vir.com
- Keywords: sequence points expression evaluation
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]
-
- For reasons of virtual memory swapping, we have what amounts to the following:
-
- int* A (int i)
- {
- static int x;
-
- x = i;
- return &x;
- }
-
- foo ( )
- {
- .....
- *A(1) += *A(100);
- }
-
- This fails due to the value *A(100) not being stored before the *A(1) is
- evaulated. The following works:
-
- int tmp = *A(100);
- *A(1) += tmp;
-
- Is there another alternative to the use of tmp variables?
-
-